class AddRoomRelationship < ActiveRecord::Migration
  def self.up
    add_column :boxes, :room_id, :integer, :null => false
    add_index :boxes, :room_id
    Room.create! :name => 'Salle principale' if Room.count == 0
    Box.update_all :room_id => Room.find(:first).id
  end

  def self.down
    remove_column :boxes, :room_id
  end
end
